from selenium.webdriver.support.select import Select
from selenium.webdriver.common.by import By
from selenium import webdriver
drvier = webdriver.Chrome()
drvier.get("http://sahitest.com/demo/selectTest.htm")
drvier.maximize_window()
drvier.implicitly_wait(15)

# 先定位到下拉框
s1 = drvier.find_element(By.ID,"s1Id")

#根据索引位置选择下拉框
"""
index_s1 = Select(s1)
index_s1.select_by_index(3) 
"""

# 根据value值来进行选择
"""
value_s1 = Select(s1)
value_s1.select_by_value("o1")
"""

# 根据手动输入来进行选择
"""
input_text_s1 = Select(s1)
input_text_s1.select_by_visible_text("o3")
"""





